<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

$cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework');
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TURISRIO</title>
<script type="text/javascript">
        startList = function() {
        if (document.all&&document.getElementById) {
        navRoot = document.getElementById("menuDropDown");
        for (i=0; i<navRoot.childNodes.length; i++) {
        node = navRoot.childNodes[i];
        if (node.nodeName=="LI") {
        node.onmouseover=function() {
        this.className+=" over";
          }
          node.onmouseout=function() {
          this.className=this.className.replace
            (" over", "");
           }
           }
          }
         }
        }
        window.onload=startList;
    </script>

<script type="text/javascript">
		var WWW_ROOT = '<?= $this->Html->url('/') ?>';
    </script>
	<!--script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script!-->
    <?php
    echo $this->Html->script('jquery');		
    echo $this->Html->script('maskinput');
    echo $this->Html->css('novo/style');
    echo $this->Html->css('novo/jsDatePick_ltr.min');

    echo $this->Html->script('novo/calendar/jsDatePick.jquery.min.1.3');
    echo $this->Html->script('novo/calendar/calendar');
    
    echo $this->Html->script('bootstrap');
    echo $this->Html->css('bootstrap');
    
    ?>
        
        <script>
    
                 
        $(document).ready(function() {
           //alert('dsa');
                    
                 
                 
                 $('#buscaBtn').click(function() {
                    //alert($('#BuscaProtocolo').val());
                    var protocolo = $('#BuscaProtocolo').val();
                    window.location="http://<?=$_SERVER['HTTP_HOST']?>/occurrences/view/search/"+protocolo;
                });
                
            //alert('dsa');
            /*$('.identificador').mask("19.888888.88.8888-8");
            $('.dataBrasil').mask("88/88/8888");
            $('.cpf').mask("888.888.888-88");
            $('.tel').mask("(88) 8888 - 8888");
            $('.cadastro_input').mask("(88) 8888 - 8888");
            $('.cnpj').mask("88.888.888/8888-88");
            $('.processo').mask("888888-88.88.8888");
            */

            $("#GuiaCadastradoS").click(function(){
                //alert('das');
                $('#SituacaoGuia').slideDown();
            });
  
            $("#GuiaCadastradoN").click(function(){
                $('#SituacaoGuia').slideUp();
                $('#OcorrenciaSituacao').val(0);
            });
            

            //  Cadastro de Ocorrência
            $("#OccurrenceOrigin").change(function()
            {
                if($("#OccurrenceOrigin").val()=='Instituição Parceira')
                {
                    $('.OcorrenciaDestinos').slideUp();
                    $('#InstituicoesParceiras').slideDown();
                    $('#OccurrenceInstitutionId').val($('#OccurrenceInstitutionPartnerId option:first').val());
                }
                else if($("#OccurrenceOrigin").val()=='Instituição não Parceira')
                {
                    $('.OcorrenciaDestinos').slideUp();
                    $('#OrgaosPublicos').slideDown();
                    $('#OccurrenceInstitutionId').val($('#OccurrenceInstitutionNotpartnerId option:first').val());
                }
                else
                {
                    $('.OcorrenciaDestinos').slideUp();
                    $('#OccurrenceInstitutionId').val('0');
                }
            });
            
            $("#OccurrenceInstitutionPartnerId").change(function()
            {
                $('#OccurrenceInstitutionId').val($(this).val());
            });
            $("#OccurrenceInstitutionNotpartnerId").change(function()
            {
                $('#OccurrenceInstitutionId').val($(this).val());
            });
            
            //  end
            $('.dinheiro').maskMoney({
            showSymbol:false,
            symbol:'', 
            decimal:'.', 
            thousands:'',
            precision:2
            });
        });
    </script>

</head>

<body>
<center>
    
</center>
<!--menu-->
<div id="corpo">
    <div id="topo"> 
        <?php echo $this->Html->link($this->Html->image('novo/logo_pit.png',array('class'=>'logo_pit')), array('controller'=>'occurrences', 'action'=>'index'), array('escape'=>false));?></a>
        <?php echo $this->Html->image('novo/logo2.jpg',array('class'=>'logo2'))?>  
    </div>

    <div id="menu">
        <ul>
            <li class="menu"><?php echo $this->Html->image('novo/menu/nova_ocorrencia.png');?>
                <p>Registrar Ocorrência</p>
                <ul>
                    <?= $this->Html->link('<li class="menu2">Pessoa Jurídica</li>', array('controller' => 'occurrences', 'action' => 'add/juridic'), array('escape'=>false));?>
                    <?= $this->Html->link('<li class="menu2"> Guia de Turismo </li>', array('controller' => 'occurrences', 'action' => 'add/guide'), array('escape'=>false));?>
                     <?= $this->Html->link('<li class="menu2">Pessoa Física</li>', array('controller' => 'occurrences', 'action' => 'add/fisic'), array('escape'=>false));?>
                </ul>
            </li>
            <li class="menu"><?php echo $this->Html->image('novo/menu/gerar_relatorio.png');?></br>
            <p><?= $this->Html->link('Gerar Relatório', array('controller' => 'occurrences', 'action' => 'reports'), array('target'=>'_blank'));?></p>
            </li>
            
            <li class="menu"><?php echo $this->Html->image('novo/menu/ocorrencias.png');?><p>Ocorrências</p>
		<ul>
                    <?= $this->Html->link('<li class="menu2">Pesquisar</li>', array('controller' => 'occurrences', 'action' => 'search'), array('escape'=>false));?>
                    <?
                    if($usuario_info['User']['role'] == 'Operador')
                    {
                             
                    }
                    else
                    {
                   ?>
                  <?= $this->Html->link('<li class="menu2">Análise</li>', array('controller' => 'occurrences', 'action' => 'view/new'), array('escape'=>false));?>
                   <?
                    }
                   ?>
                  <?= $this->Html->link('<li class="menu2">Pendentes</li>', array('controller' => 'occurrences', 'action' => 'view'), array('escape'=>false));?>
                  <?= $this->Html->link('<li class="menu2">Solucionadas</li>', array('controller' => 'occurrences', 'action' => 'view/resolved'), array('escape'=>false));?>                  
                </ul>
            </li>
            <?
            if($usuario_info['User']['role'] == 'Administrador')
            {
            ?>
             <li class="menu"><?php echo $this->Html->image('novo/menu/operadores.png');?></br> <p>Operador</p>
		<ul>
                    <?= $this->Html->link('<li class="menu2">Incluir Operador</li>', array('controller' => 'users', 'action' => 'add'), array('escape'=>false));?>
                    <?= $this->Html->link('<li class="menu2">Listar Operador</li>', array('controller' => 'users', 'action' => 'index'), array('escape'=>false));?>
                    
                </ul>
            </li>
            
            <?
            }
            ?>
         
            <li class="menu"><a href="#" target="_self"><?php echo $this->Html->image('novo/menu/prestadores.png');?><p>Prestadores de Serviços</p></a>
		<ul>
                    <?= $this->Html->link('<li class="menu2">Incluir Pessoa Jurídica</li>', array('controller' => 'establishments', 'action' => 'add'), array('escape'=>false));?>
                    <?= $this->Html->link('<li class="menu2">Listar Pessoa Jurídica</li>', array('controller' => 'establishments', 'action' => 'index'), array('escape'=>false));?>
                    <?= $this->Html->link('<li class="menu2">Incluir Guia de Turismo</li>', array('controller' => 'guides', 'action' => 'add'), array('escape'=>false));?>
                    <?= $this->Html->link('<li class="menu2">Listar Guias de Turismo</li>', array('controller' => 'guides', 'action' => 'index'), array('escape'=>false));?>                 
                    <?= $this->Html->link('<li class="menu2">Incluir Pessoa Física</li>', array('controller' => 'individuals', 'action' => 'add'), array('escape'=>false));?>
                    <?= $this->Html->link('<li class="menu2">Listar Pessoa Física</li>', array('controller' => 'individuals', 'action' => 'index'), array('escape'=>false));?>
                </ul>
            </li>
            <li class="menu"><a href="#" target="_self"><?php echo $this->Html->image('novo/menu/instituicoes.png');?><p>Instituições</p></a>
		<ul>
                    <?= $this->Html->link('<li class="menu2">Incluir Instituição</li>', array('controller' => 'institutions', 'action' => 'add'), array('escape'=>false));?>
                    <?= $this->Html->link('<li class="menu2">Listar Instituições</li>', array('controller' => 'institutions', 'action' => 'index'), array('escape'=>false));?>                  
                </ul>
            </li>        
        </ul>
    </div>
<!--endmenu-->
        <div id="bemvindo">
            <div id="home"><a href="#" target="_self"><?php echo $this->Html->link(
    $this->Html->image("novo/home.png", array("alt" => "home")),
    array("controller" => "occurrences","action"=>"index"),
    array('escape' => false)
);?></a></div>
            <div id="home_bemvindo">Bem vindo ao Sistema do Programa Integrado de Turismo</div>
            <div id="home_operador"><?php echo $this->Html->image('novo/operador.png',array('align'=>'absmiddle'));?>&nbsp; Olá, <strong><?= $usuario_info['User']['name']; ?></strong></div>
            <div id="sair_sistema"><?= $this->Html->link('Sair do Sistema', array('controller' => 'users', 'action' => 'logout'));?></div>
        </div>
     
        <div id="content">
        	<?php
        	//start content
        	echo $content_for_layout;
        	//end content
        	?>
        </div>
        
        
    <div id="footer">
     Programa  Integrado de Turismo Pertence à TurisRio que detém todos os Direitos
    </div>         
</div>
       
</body>
</html>